package study;

public class Equals extends Parent{

    public static void main(String[] args){
        Parent a=new Parent();
        a.age=10;
        a.name="xiaohuan";
        a.sex="男";
        Parent b=new Parent();
        b.name="xiaohuan";
        b.sex="男";
        b.age=10;
        if (a.equals(b)){
            System.out.println("a和b是相等的！"+a.toString());
        } else {
            System.out.println("a和b是不相等的！"+a.toString());
        }
    }
}
